﻿CREATE PROCEDURE [dbo].[proc_Finance_Balance_Getlist_Count]
	(
		@CompanyId int,
		@StartDate nvarchar(10),
		@EndDate nvarchar(10),
		@Stext nvarchar(50)
	)
AS
	Select Count(Id),Sum(Prices) From Finance_Balance
	Where (@CompanyId=0 Or CompanyId=@CompanyId) and (Convert(nchar(10),CurrentDate,120) between @StartDate and @EndDate)
	and (@Stext='' Or Reason like '%'+@Stext+'%')
	RETURN
